<template>
  <div class="m-8">
    <CityPicker></CityPicker>
  </div>
</template>
<script>
import CityPicker from "@/components/CityPicker.vue";
export default {
  name: "PagesUser",
  /**
   * 调用组建
   * @type {Object}
   */
  components: {
    CityPicker,
  },
  /**
   * 组建属性
   * @type {Object}
   */
  props: {
  },
  /**
   * 数据字段
   * @return {[type]} [description]
   */
  data() {
    return {
      title:'hello',
      level1:0,
      level2:0,
      city:"",
      formInline: {
        city: '',
        prov: '',
        districts:'',
      },
    };
  },
  /**
   * 计算属性
   * @type {Object}
   */
  computed: {
    //使用计算属性把数据拿出来
  },
  /**
   * 数据监听
   * @type {Object}
   */
  watch: {},
  /**
   * 页面创建时
   * @return {[type]} [description]
   */
  created() {

  },
  /**
   * 页面加载时
   * @return {[type]} [description]
   */
  mounted() {

  },
  /**
   * 页面调用函数
   * @type {Object}
   */
  methods: {
    onSubmit() {
      console.log('submit!');
    },
    handleProv(val) {
      this.city = [];
      this.formInline.city = "";
      this.formInline.districts = "";
      console.log("123123", val)
      for (let index in City) {
        let item = City[index];
        if (item.prov === this.formInline.prov) {
          this.city.push(item);
        }
      }
    },
    handleCity() {
      for (let districts of districts) {
        console.log('ddd', districts, this.formInline.prov, this.formInline.city)
        if (districts.prov === this.formInline.prov && districts.label === this.formInline.city) {
          console.log('ccc', districts)
          this.ClassDistricts = districts.districts
        }
      }
    },
  }
};
</script>
<style scoped>

</style>